package com.emm.yixun.jobs;

import com.emm.yixun.common.app.base.CommonResDTO;
import com.emm.yixun.common.response.Response;
import com.emm.yixun.customer.service.CustomerServiceFacade;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class CustomerAutoGiveupJob {
	private static Logger logger = LoggerFactory.getLogger(CustomerAutoGiveupJob.class);

	@Autowired
	private CustomerServiceFacade customerServiceFacade;

	@Scheduled(cron = "${quartz.cron.customerGiveup}")
	public void customerCareNotice() {
		logger.info("客户自动放弃 job start..........");
		Response<CommonResDTO> response = customerServiceFacade.customerAutoGiveup(null);
		if (response.isSuccess()) {
			logger.info("..........客户自动放弃执行完成..........");
		} else {
			logger.info("..........客户自动放弃执行完成..........");
		}
		logger.info("客户自动放弃 job end..........");
	}

}
